package com.slatch;

public class Terrain extends Entite {
	
	private Unite aUnite;
	private TypeTerrain aType;
	protected int aPVMax;
    protected int aPV;
	
	public Terrain(final int pX,
	        final int pY,
	        final int pJoueur,
	        final TypeTerrain pType) {
		
		super(pX,pY,pJoueur);
		aType=pType;
		aPVMax = pType.getPVMax();
        aPV = pType.getPVMax();
	}
	
	public Terrain(final int pX,final int pY,final int pJoueur,final TypeTerrain pType,final int pPV) 
    {
        super(pX,pY,pJoueur);
        aType = pType;
        aPVMax = pType.getPVMax();
        if(pPV==0){
            aPV =  pType.getPVMax();
        }
        else{
            aPV = pPV;
        }
        
    }
	
	public String getDrawable() {return (aType.getImage()+super.aJoueur);}
    public Unite getUnite() {return aUnite;}
    public void setUnite(final Unite pUnite) {aUnite = pUnite;}  
    public TypeTerrain getType() {return aType;}
    public int getCout(Unite unite) {return this.aType.aCoutDeplacement.get(unite.getType().getTypeDeplacement().getNom());}
    public int getPV() {return aPV;}
    public void setPV(final int pPV) {aPV=pPV;}
}
